#include "dma_config.h"
#include "bsp.h"
#include "stm32f4xx_hal.h"

void MX_DMA_Init(void)
{
    /* DMA controller clock enable */
    __HAL_RCC_DMA2_CLK_ENABLE();

    /* DMA interrupt init */
    /* DMA2_Stream0_IRQn interrupt configuration */
    // adc_dma，不启动adc dma中断，而是根据应用需要定时去缓存中查询adc值
    HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 11, 0);
    HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn);

    /* DMA2_Stream7_IRQn interrupt configuration */
    // uart dma
    HAL_NVIC_SetPriority(DMA2_Stream7_IRQn, 12, 0);
    HAL_NVIC_EnableIRQ(DMA2_Stream7_IRQn);
}
